package nz.helloworld;

import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Container;

import javax.swing.JButton;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JPanel;

public class AwtSwing {

	JFrame frame = new JFrame("Test AWT and SWING");
	JDesktopPane jdp = new JDesktopPane();
	JInternalFrame jif1 = new JInternalFrame("controls");
	JInternalFrame jif2 = new JInternalFrame("cover");

	public AwtSwing() {
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().add(jdp);

		Container contentPane1 = new JPanel();// jif1.getContentPane();
		contentPane1.setLayout(new BorderLayout());
		contentPane1.add(new Button("AWT Button"), BorderLayout.WEST);
		contentPane1.add(new JButton("Swing Button"));
		jif1.setContentPane(contentPane1);

		jif1.setSize(200, 100);

		jif2.setContentPane(new JPanel());
		jif2.setSize(200, 100);

		jdp.add(jif1);
		jdp.add(jif2);

		frame.setSize(400, 300);
	}

	private void show() {
		frame.setVisible(true);
		jif1.setVisible(true);
		jif2.setVisible(true);
	}

	public static void main(String[] args) {
		AwtSwing as = new AwtSwing();
		as.show();
	}

}
